﻿@page
@model IndexModel
@{
    ViewData["Title"] = "Home page";
}

<div class="text-center">
    <h1 class="display-4">Welcome</h1>
    <p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>

    <input id="mac" type="text" name="mac" value="" />

    <button type="button" onclick="send()" >启动</button>

    <script type="text/javascript">
        function send() {
            let mac = document.getElementById('mac').value;
            var url = '@Url.Action("SendWol", "Home")?mac=' + mac;
            fetch(url, { method:'POST' })
            .then(response => response.json())
            .then(data => console.log(data));
    }
    </script>
</div>
